const {ipcRenderer} = require('electron');

let asyncIpcBtn = document.getElementById('asyncIpcBtn');
asyncIpcBtn.addEventListener('click', () => {
    // 如果改为sendSync即是同步发消息
    console.log("芜湖, 消息我发过去咯~");
    ipcRenderer.send('async-msg', '这里是demo06的渲染进程，我发送了一个async-msg');
    console.log("消息返回没呀？");
});

ipcRenderer.on('async-reply', ((event, args) => {
    console.log("渲染进程收到'async-reply', args: ", args);
    document.getElementById('div').innerHTML = args;
}));

ipcRenderer.on('sendToMainWindow', ((event, args) => {
    alert(args);
}));